# -*- coding:utf-8 -*-
#Author LJ 
#Mail:admin@attacker.club
#Site:blog.attacker.club
#description

import re
info_list = [
'192.168.1.2',
'123',
'account-1-2',
'account-1-3',
'account-1-4',
'192.10.98.233',
]


def info_list1 ():
    for list in info_list:
        print  list



def check_ip (info):
    completed_ip = open("completed_ip.txt", 'a+')
    print  "info",info
    for i in completed_ip:
        print  info,"与",i
        if info == i.split()[0]:
            print '跳过重复 %s' % info
            break

        else:
            completed_ip.write(info+'\n')
            print '存入记录：%s' % info

            continue


"""     if info in completed_ip.readlines():   
        print '跳过重复 %s' % info
        completed_ip.close()
    else:
        completed_ip.write(info+'\n')
        print '存入记录：%s' % info
        completed_ip.close()
"""









    #for recard in completed_ip.readlines():
    #    print  "3",recard








     #while True:
         #check_ip (list)
      #   break

"""




  for exist_ip in completed_ip.readlines():
        print  completed_ip.readlines()
        print '跳过重复 %s' % info
        completed_ip.close()
        break
    else:
        completed_ip.write(info+'\n')
        print '存入记录：%s' % info
        completed_ip.close()
        return  True
        



    print  lock
    print lock,type(lock)
    if list in lock:
        print '跳过重复 %s' % ip
        completed_ip.close()
        return False
    else:
        completed_ip.write(ip+'\n')
        print '存入新记录：%s' % ip
        completed_ip.close()
    


if __name__ == "__main__":
    for list in info_list :
        while True:
            info = list
            check_ip (info)
            break
            #print list



hostname = list[0]
print hostname
for  host in list:
	print host
	if re.match(r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", host):
		print host
	else:
		return False
       
#print (re.findall(r'^\d(.*)',list[0]) )
"""